package com.maple.model.error

enum class ERROR(private val success: Boolean,private val code: String?, private val err: String?) {

    /**
     * 未知错误
     */
    UNKNOWN(false,"1000", "未知错误!"),
    /**
     * 解析错误
     */
    PARSE_ERROR(false,"2000", "解析错误"),
    /**
     * 网络错误
     */
    NETWORD_ERROR(false,"3000", "网络错误!"),
    NETWORD_UNCONNECTED(false,"3001", "网络异常,请检查网络！"),
    /**
     * 协议出错
     */
    HTTP_ERROR(false,"4000", "协议出错"),
    /**
     * 连接超时
     */
    TIMEOUT_ERROR(false,"5000", "连接超时"),
    /**
     * 证书出错
     */
    SSL_ERROR(false,"6000", "证书出错"),
    /**
     * 数据异常
     */
    DATA_ERROR(false,"7000", "数据异常"),
    /**
     * 服务错误
     */
    SERVER_ERROR(false,"8000", "服务错误!");
    fun isSuccess(): Boolean {
        return success
    }

    fun getValue(): String? {
        return err
    }

    fun getKey(): String? {
        return code
    }

}